<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!-- Copyright 1997 The Open Group, All Rights Reserved -->
<title>ipcs</title>
</head><body bgcolor=white>
<center>
<font size=2>
The Single UNIX &reg; Specification, Version 2<br>
Copyright &copy; 1997 The Open Group

</font></center><hr size=2 noshade>
<h4><a name = "tag_001_014_1004">&nbsp;</a>NAME</h4><blockquote>
ipcs - report inter-process communication facilities status
</blockquote><h4><a name = "tag_001_014_1005">&nbsp;</a>SYNOPSIS</h4><blockquote>
<pre><code>

ipcs <b>[</b> -qms <b>] [</b> -a | -bcopt <b>]</b>
</code>
</pre>
</blockquote><h4><a name = "tag_001_014_1006">&nbsp;</a>DESCRIPTION</h4><blockquote>
The
<i>ipcs</i>
utility writes information about active inter-process
communication facilities.
<p>
Without options, information is written in short format for
message queues, shared memory segments and semaphores sets
that are currently active in the system.
Otherwise, the information that is displayed is controlled by the
options specified.
</blockquote><h4><a name = "tag_001_014_1007">&nbsp;</a>OPTIONS</h4><blockquote>
The
<i>ipcs</i>
facility supports the <b>XBD</b> specification, <a href="../xbd/utilconv.html#usg"><b>Utility Syntax Guidelines</b>&nbsp;</a> .
<p>
The
<i>ipcs</i>
utility accepts the following options:
<dl compact>

<dt><b>-q</b>
<dd>Write information about active message queues.

<dt><b>-m</b>
<dd>Write information about active shared memory segments.

<dt><b>-s</b>
<dd>Write information about active semaphores sets.

</dl>
<p>
If
<b>-q</b>,
<b>-m</b>
or
<b>-s</b>
are specified, only information about those facilities is written.
If none of these three are specified, information about all three
is written subject to the following options:
<dl compact>

<dt><b>-a</b>
<dd>Use all print options.
(This is a shorthand notation for
<b>-b</b>,
<b>-c</b>,
<b>-o</b>,
<b>-p</b>
and
<b>-t</b>.)

<dt><b>-b</b>
<dd>Write information on maximum allowable size.
(Maximum number of bytes in messages on queue for message
queues, size of segments for shared memory, and number
of semaphores in each set for semaphores.)

<dt><b>-c</b>
<dd>Write creator's user name and group name.
See below.

<dt><b>-o</b>
<dd>Write information on outstanding usage.
(Number of messages on queue and total number of bytes in messages
on queue for message queues, and number of processes
attached to shared memory segments.)

<dt><b>-p</b>
<dd>Write process number information.
(Process ID of last process to send a message and process ID of
last process to receive a message on message queues, process ID of
creating process, and process ID of last process to
attach or detach on shared memory segments.)

<dt><b>-t</b>
<dd>Write time information.
(Time of the last control operation that changed the access
permissions for all facilities, time of last
<i><a href="../xsh/msgsnd.html">msgsnd()</a></i>
and
<i><a href="../xsh/msgrcv.html">msgrcv()</a></i>
operations on message queues, time of last
<i><a href="../xsh/shmat.html">shmat()</a></i>
and
<i><a href="../xsh/shmdt.html">shmdt()</a></i>
operations on shared memory, and time of last
<i><a href="../xsh/semop.html">semop()</a></i>
operation on semaphores.)

</dl>
</blockquote><h4><a name = "tag_001_014_1008">&nbsp;</a>OPERANDS</h4><blockquote>
None.
</blockquote><h4><a name = "tag_001_014_1009">&nbsp;</a>STDIN</h4><blockquote>
Not used.
</blockquote><h4><a name = "tag_001_014_1010">&nbsp;</a>INPUT FILES</h4><blockquote>
<ul>
<p>
<li>
the group database
<p>
<li>
the user database.
<p>
</ul>
</blockquote><h4><a name = "tag_001_014_1011">&nbsp;</a>ENVIRONMENT VARIABLES</h4><blockquote>
The following environment variables affect the execution of
<i>ipcs</i>:
<dl compact>

<dt><i>LANG</i><dd>Provide a default value for the internationalization
variables that are unset or null.
If
<i>LANG</i>
is unset or null, the corresponding value from the
implementation-dependent default locale will be used.
If any of the internationalization variables contain an invalid setting,
the utility will behave as if none of the variables had been set.

<dt><i>LC_ALL</i><dd>If set to a non-empty string value, override the values
of all the other internationalization variables.

<dt><i>LC_CTYPE</i><dd>
Determine the locale for the interpretation of
sequences of bytes of text data as characters (for
example, single- as opposed to multi-byte characters in
arguments).

<dt><i>LC_MESSAGES</i><dd>
Determine the locale that should be used to affect the
format and contents of diagnostic messages written to
standard error.

<dt><i>NLSPATH</i><dd>
Determine the location of message catalogues for the
processing of
<i>LC_MESSAGES .
</i>
<dt><i>TZ</i><dd>Determine the timezone for the time strings written by
<i>ipcs</i>.

</dl>
</blockquote><h4><a name = "tag_001_014_1012">&nbsp;</a>ASYNCHRONOUS EVENTS</h4><blockquote>
Default.
</blockquote><h4><a name = "tag_001_014_1013">&nbsp;</a>STDOUT</h4><blockquote>
An introductory line is written with the format:
<pre>
<code>
"IPC status from %s as of %s\n", &lt;<i>source</i>&gt;, &lt;<i>date</i>&gt;
</code>
</pre>
<p>
where &lt;<i>source</i>&gt; indicates the source used to gather the
statistics and &lt;<i>date</i>&gt; is the information that would be
produced by the command:
<pre>
<code>
date
</code>
</pre>
<p>
when invoked in the POSIX locale.
<p>
The
<i>ipcs</i>
utility then creates up to three reports depending
upon the
<b>-q</b>,
<b>-m</b>
and
<b>-s</b>
options.
The first report indicates the status of message queues,
the second report indicates the status of shared memory segments,
and the third report indicates the status of semaphore sets.
<p>
If the corresponding facility is not installed or has not been
used since the last reboot, then the report is written out in
the format:
<pre>
<code>
"%s facility not in system.\n", &lt;<i>facility</i>&gt;
</code>
</pre>
<p>
where &lt;<i>facility</i>&gt; is
Message Queue,
Shared Memory
or
Semaphore
as appropriate.
If the facility has been installed and has been used since the
last reboot, column headings separated by one or more spaces and followed
by a new line will be written as indicated below followed by the
facility name written out using the format:
<pre>
<code>
"%s:\n", &lt;<i>facility</i>&gt;
</code>
</pre>
<p>
where &lt;<i>facility</i>&gt; is
Message Queues,
Shared Memory
or
Semaphores
as appropriate.
On the second and third reports the column headings need not
be written if the last column headings written already provide column
headings for all information in that report.
<p>
The column headings provided in the first column below and the
meaning of the information in those columns are given in order
below; the letters in parentheses indicate the options that
cause the corresponding column to appear; &quot;all&quot; means that the
column always appears.
Each column is separated by one or more space characters.
Note that these options only determine what information is provided
for each report; they do not determine which reports are written.
<dl compact>

<dt>T	(all)<dd>Type of facility:
<dl compact>

<dt><b>q</b><dd>Message queue.

<dt><b>m</b><dd>Shared memory segment.

<dt><b>s</b><dd>Semaphore.

</dl>
<p>
This field is a single character written using the format "%c".
<p>
<dt>ID	(all)<dd>The identifier for the facility entry.
This field is written using the format "%d".
<p>
<dt>KEY	(all)<dd>The key used as an argument to
<i><a href="../xsh/msgget.html">msgget()</a></i>,
<i><a href="../xsh/semget.html">semget()</a></i>
or
<i><a href="../xsh/shmget.html">shmget()</a></i>
to create the facility entry.
<dl><dt><b>Note:</b>
<dd>The key of a shared memory segment is changed to IPC_PRIVATE when
the segment has been removed until all processes
attached to the segment detach it.
</dl>
This field is written using the format "0x%x".
<p>
<dt>MODE	(all)<dd>The facility access modes and flags.
The mode consists of 11 characters that are interpreted as follows.
<p>
The first character is:
<dl compact>

<dt><b>S</b><dd>If a process is waiting on a
<i><a href="../xsh/msgsnd.html">msgsnd()</a></i>
operation.

<dt><b>-</b><dd>If the above is not true.

</dl>
<p>
The second character is:
<dl compact>

<dt><b>R</b><dd>If a process is waiting on a
<i><a href="../xsh/msgrcv.html">msgrcv()</a></i>
operation.

<dt><b>C</b>&nbsp;or&nbsp;<b>-</b><dd>If the associated shared memory segment is to be cleared
when the first attach operation is executed.

<dt><b>-</b><dd>If none of the above is true.

</dl>
<p>
The next nine characters are interpreted as three sets of three
bits each.
The first set refers to the owner's permissions; the next
to permissions of others in the usergroup of the facility entry;
and the last to all others.
Within each set, the first character indicates permission to read,
the second character indicates permission to write or alter
the facility entry, and the last character is a minus sign (-).
<p>
The permissions are indicated as follows:
<dl compact>

<dt><b>r</b><dd>If read permission is granted.

<dt><b>w</b><dd>If write permission is granted.

<dt><b>a</b><dd>If alter permission is granted.

<dt><b>-</b><dd>If the indicated permission is not granted.

</dl>
<p>
The first character following the permissions specifies if
there is an alternate or additional access control method associated
with the facility.
If there is no alternate or additional access control method
associated with the facility, a single space character
will be written; otherwise another printable
character will be written.
<p>
<dt>OWNER	(all)<dd>The user name of the owner of the facility entry.
If the user name of the owner is found in the user database,
at least the first eight column positions of the name are written using
the format "%s".
Otherwise, the user ID of the owner is written using the format "%d".
<p>
<dt>GROUP	(all)<dd>The group name of the owner of the facility entry.
If the group name of the owner is found in the group database,
at least the first eight column positions of the name are written using
the format "%s".
Otherwise, the group ID of the owner is written using the format "%d".
<p>
</dl>
<p>
The following nine columns are only written out for message
queues:
<dl compact>

<dt>CREATOR	(<b>a</b>,<b>c</b>)<dd>The user name of the creator of the facility entry.
If the user name of the creator is found in the user database,
at least the first eight column positions of the name are written
using the format "%s".
Otherwise, the user ID of the creator is written using the format "%d".

<dt>CGROUP	(<b>a</b>,<b>c</b>)<dd>The group name of the creator of the facility entry.
If the group name of the creator is found in the group database,
at least the first eight column positions of the name are written
using the format "%s".
Otherwise, the group ID of the creator is written using the format "%d".

<dt>CBYTES	(<b>a</b>,<b>o</b>)<dd>The number of bytes in messages currently outstanding on the
associated message queue.
This field is written using the format "%d".

<dt>QNUM	(<b>a</b>,<b>o</b>)<dd>The number of messages currently outstanding
on the associated message queue.
This field is written using the format "%d".

<dt>QBYTES	(<b>a</b>,<b>b</b>)<dd>The maximum number of bytes allowed in messages outstanding on
the associated message queue.
This field is written using the format "%d".

<dt>LSPID	(<b>a</b>,<b>p</b>)<dd>The process ID of the last process to send a message to the
associated queue.
This field is written using the format:
<pre>
<code>
"%d", &lt;<i>pid</i>&gt;
</code>
</pre>

where &lt;<i>pid</i>&gt; is 0 if no message has been sent
to the corresponding message queue; otherwise,
&lt;<i>pid</i>&gt; is the process ID of the last process to
send a message to the queue.

<dt>LRPID	(<b>a</b>,<b>p</b>)<dd>The process ID of the last process to
receive a message from the associated queue.
This field is written using the format:
<pre>
<code>
"%d", &lt;<i>pid</i>&gt;
</code>
</pre>

where &lt;<i>pid</i>&gt; is 0 if no message has been
received from the corresponding message queue;
otherwise, &lt;<i>pid</i>&gt; is the process ID of the last
process to receive a message from the queue.

<dt>STIME	(<b>a</b>,<b>t</b>)<dd>The time the last message was sent to the associated queue.
If a message has been sent to the corresponding message queue,
the hour, minute and second of the last time a message
was sent to the queue is written using the format "%d:%2.2d:%2.2d".
Otherwise, the format " no-entry" will be written.

<dt>RTIME	(<b>a</b>,<b>t</b>)<dd>The time the last message was received from the associated queue.
If a message has been received from the corresponding message queue,
the hour, minute and second of the last time a message was received
from the queue is written using the format "%d:%2.2d:%2.2d".
Otherwise, the format " no-entry" will be written.

</dl>
<br>
<p>
The following eight columns are only written out for shared
memory segments.
<dl compact>

<dt>CREATOR	(<b>a</b>,<b>c</b>)<dd>The user name of the creator of the facility entry.
If the user name of the creator is found in the user database,
at least the first eight column positions of the name are written
using the format "%s".
Otherwise, the user ID of the creator is written using the format "%d".

<dt>CGROUP	(<b>a</b>,<b>c</b>)<dd>The group name of the creator of the facility entry.
If the group name of the creator is found in the group database,
at least the first eight column positions of the name are written
using the format "%s".
Otherwise, the group ID of the creator is written using the format "%d".


<dt>NATTCH	(<b>a</b>,<b>o</b>)<dd>The number of processes attached to the
associated shared memory segment.
This field is written using the format "%d".

<dt>SEGSZ	(<b>a</b>,<b>b</b>)<dd>The size of the associated shared memory segment.
This field is written using the format "%d".

<dt>CPID	(<b>a</b>,<b>p</b>)<dd>The process ID of the creator of the shared memory entry.
This field is written using the format "%d".

<dt>LPID	(<b>a</b>,<b>p</b>)<dd>The process ID of the last process to attach
or detach the shared memory segment.
This field is written using the format:
<pre>
<code>
"%d", &lt;<i>pid</i>&gt;
</code>
</pre>

where &lt;<i>pid</i>&gt; is 0 if no process has attached
the corresponding shared memory segment;
otherwise, &lt;<i>pid</i>&gt; is the process ID of the
last process to attach or detach the segment.

<dt>ATIME	(<b>a</b>,<b>t</b>)<dd>The time the last attach on the associated
shared memory segment was completed.
If the corresponding shared memory segment
has ever been attached, the hour, minute
and second of the last time the segment was
attached is written using the format "%d:%2.2d:%2.2d".
Otherwise, the format " no-entry" will be written.

<dt>DTIME	(<b>a</b>,<b>t</b>)<dd>The time the last detach on the associated
shared memory segment was completed.
If the corresponding shared memory segment
has ever been detached, the hour, minute,
and second of the last time the segment was
detached is written using the format "%d:%2.2d:%2.2d".
Otherwise, the format " no-entry" will be written.

</dl>
<p>
The following four columns are only written out for semaphore sets:
<dl compact>

<dt>CREATOR	(<b>a</b>,<b>c</b>)<dd>The user name of the creator of the facility entry.
If the user name of the creator is found in the user database,
at least the first eight column positions of the name are written
using the format "%s".
Otherwise, the user ID of the creator is written using the format "%d".

<dt>CGROUP	(<b>a</b>,<b>c</b>)<dd>The group name of the creator of the facility entry.
If the group name of the creator is found in the group database,
at least the first eight column positions of the name are written
using the format "%s".
Otherwise, the group ID of the creator is written using the format "%d".


<dt>NSEMS	(<b>a</b>,<b>t</b>)<dd>The number of semaphores in the set associated
with the semaphore entry.
This field is written using the format "%d".

<dt>OTIME	(<b>a</b>,<b>t</b>)<dd>The time the last semaphore operation on the
set associated with the semaphore entry was completed.
If a semaphore operation has ever been performed on the
corresponding semaphore set, the hour, minute and second of the last
semaphore operation on the semaphore set
is written using the format "%d:%2.2d:%2.2d".
Otherwise, the format " no-entry" will be written.

</dl>
<p>
The following column is written for all three reports when
it is requested:
<dl compact>

<dt>CTIME	(<b>a</b>,<b>t</b>)<dd>The time the associated entry was created or changed.
The hour, minute and second of the time when the associated entry
was created are written using the format "%d:%2.2d:%2.2d".

</dl>
</blockquote><h4><a name = "tag_001_014_1014">&nbsp;</a>STDERR</h4><blockquote>
Used only for diagnostic messages.
</blockquote><h4><a name = "tag_001_014_1015">&nbsp;</a>OUTPUT FILES</h4><blockquote>
None.
</blockquote><h4><a name = "tag_001_014_1016">&nbsp;</a>EXTENDED DESCRIPTION</h4><blockquote>
None.
</blockquote><h4><a name = "tag_001_014_1017">&nbsp;</a>EXIT STATUS</h4><blockquote>
The following exit values are returned:
<dl compact>

<dt> 0<dd>Successful completion.

<dt>&gt;0<dd>An error occurred.

</dl>
</blockquote><h4><a name = "tag_001_014_1018">&nbsp;</a>CONSEQUENCES OF ERRORS</h4><blockquote>
Default.
</blockquote><h4><a name = "tag_001_014_1019">&nbsp;</a>APPLICATION USAGE</h4><blockquote>
Things can change while
<i>ipcs</i>
is running; the information it gives is guaranteed to be accurate
only when it was retrieved.
</blockquote><h4><a name = "tag_001_014_1020">&nbsp;</a>EXAMPLES</h4><blockquote>
None.
</blockquote><h4><a name = "tag_001_014_1021">&nbsp;</a>FUTURE DIRECTIONS</h4><blockquote>
None.
</blockquote><h4><a name = "tag_001_014_1022">&nbsp;</a>SEE ALSO</h4><blockquote>
The <b>XSH</b> specification description of
<i><a href="../xsh/msgrcv.html">msgrcv()</a></i>,
<i><a href="../xsh/msgsnd.html">msgsnd()</a></i>,
<i><a href="../xsh/semget.html">semget()</a></i>,
<i><a href="../xsh/semop.html">semop()</a></i>,
<i><a href="../xsh/shmat.html">shmat()</a></i>,
<i><a href="../xsh/shmdt.html">shmdt()</a></i>,
<i><a href="../xsh/shmget.html">shmget()</a></i>.
</blockquote><hr size=2 noshade>
<center><font size=2>
UNIX &reg; is a registered Trademark of The Open Group.<br>
Copyright &copy; 1997 The Open Group
<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]

</font></center><hr size=2 noshade>
</body></html>
